Tavern system
The tavern system is an OSRS feature in the coding phase that implements a variety of important tavern functions automatically. This system is suitable for use in single-player, multiplayer session-based, and persistent world settings. A critical goal of this system is to not be tied down to a particular area; the module builder must be able to simply import a file and apply the scripts and NPCs to any desired area. In addition, the system must be easy to understand and modify, as well as being very flexible. Shift-change system The shift-change subsystem is under construction. It is intended to allow different "casts of characters" to be present in the tavern's common room depending upon the time of day. This system will require a set of special, inaccessible (except to DMs) areas to house the different shifts' personnel when they are not in the tavern. The DM or module designer can thereby set up the cast as desired, provided the NPCs are tagged properly. They will be spawned at the correct time and place automatically. The tags to be used are "osrs_tavern_bartender", "osrs_tavern_waitress", "osrs_tavern_regular", and "osrs_tavern_irregular". Irregulars will have special handling that provides for a die roll to determine if they make an appearance in the tavern for each shift. This random probability will be adjustable from NPC to NPC. Room-rental system The room rental subsystem is under construction. It is intended to allow rooms to be rented for the night. This system must be open-ended. The module builder should be able to use this system regardless of the number of rooms or their type and cost. To this end, a simple system will be used. Each room is identified by its door, which is given a tag of the form os_room_XXX_YYY where "XXX" is replaced by the inn's unique id (allowing the module to have more than one inn) and "YYY" is replaced by the room number. (This feature otherwise follows the OSRS naming rules.) There is no upper limit, technically, to how many rooms there can be. The key for this room bears the same tag, allowing it to be matched to its room. The cost of the room is implemented as the cost of the key as sold by a store, and the key's name and description should identify the type of room to the player. This approach should avoid some complex scripting and reduce the number of local variables required. Rooms are rented on a "pay-in-advance-per-night" system. Each key, when purchased, gets a local variable set on it that identifies its expiration time. Initially, the key will automatically disappear when the time is up, returning to the innkeeper's store's inventory. This will allow unlimited use of the key between rental and expiry. The script that will make the key disappear and return to the store is still needed, and ideas on how to do this are welcome. A more realistic approach planned for the future is to have someone appear near a PC who tries to use an expired key, offering them the opportunity to pay another night's (or nights') rent, and taking the key back if they do not or cannot pay. Some additional scripts and a conversation are needed for this future functionality. The first script would execute when a room door is opened. This script should compare the current day and time to the expiration time stored on the key. If the time has expired, an appropriate inn official should be spawned and made to start a conversation with the PC. The remaining required scripts support the conversation that the inn official starts, the conversation that offers the PC the opportunity to purchase more room time and that will repossess the key if the PC declines. Waitress/bartender scripts The waitress and bartender scripts are under construction. They are intended to allow a store panel to be opened from a conversation with a waitress or bartender. An option that allows a waitress to take an order, walk to the bar (to appear to collect it), then return to deliver the order, is also planned, but this option is not a top priority at this time. Patron and staff ambient animation scripting Plenty of animation scripting is planned, but not implemented yet. Technical notes *Each tavern must have a main area that is comprised of the tavern's main floor, including a common room. The rental rooms can either be in a separate upstairs area or in the main area, provided all the rental rooms are present, each with an appropriately-tagged and locked door. category:OSRS features